﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;

public partial class MasterPageMain : System.Web.UI.MasterPage, IMasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string pageName = GetPageUrlFileName().ToLower();
        if (pageName == "default.aspx")
        {
            uxSiteMap.Visible = false;
        }
        if (uxSiteMap.Visible)
        {
            if (((NormalPage)Page).CurrentLanguage == "vn")
            {
                uxSiteMap.SiteMapProvider = "SiteMapVN";
            }
            else
            {
                uxSiteMap.SiteMapProvider = "SiteMapEN";
            }
        }
    }

    private string GetPageUrlFileName()
    {
        return HttpContext.Current.Request.Url.Segments.Length > 0 ? HttpContext.Current.Request.Url.Segments[HttpContext.Current.Request.Url.Segments.Length - 1] : string.Empty;
    }

    public void AjaxAddResponseScript(string script)
    {
        uxRadAjaxManager.ResponseScripts.Add(script);
    }
}
